<template>
  <div class="home">


    <template>
      <el-table
          :data="tableData"
          style="width: 100%"
          :default-sort = "{prop: 'date', order: 'descending'}"
      >
        <el-table-column
            prop="id"
            label="ID"
      
            width="180">
        
            
        </el-table-column>
        </el-table-column>
        <el-table-column
            prop="goodsname"
            label="分类名称"
    
            width="180">
        </el-table-column>


        <el-table-column
            prop="img"
            label="分类图片"
        >
          <template v-slot="item">
            <img :src="'http://localhost:3000'+item.row.img" style="width: 100px;height:100px">
          </template>
        </el-table-column>


    
        <el-table-column  label="操作">
          <template v-slot="item">
            <el-button type="primary" icon="el-icon-edit" circle></el-button>

            <el-button type="warning" icon="el-icon-circle-plus" circle></el-button>
            <el-button type="danger" icon="el-icon-delete" circle></el-button>

          </template>
        </el-table-column>





        <!--
               <template v-for="itemChild in item.children">
                 <el-menu-item  :index="itemChild.path" :key="itemChild.path" @click="changeurl(itemChild.path,itemChild.name)">
                   <img :src="childrenIndex == itemChild.name ? itemChild.active : itemChild.icon" alt="">
                   <span slot="title">{{itemChild.name}}</span>
                 </el-menu-item>
               </template>  -->


      </el-table>
    </template>


  </div>
</template>

<script>

import {mapState,mapGetters} from "vuex"
import {mapActions,mapMutations} from 'vuex'
export default {
  computed:{
    ...mapState({tableData:state=>state.good.tableData})
  },
  created(){
    // this.$store.dispatch('getTableActions')

    this.getTableActions()
  },
  data() {
    return {
      /* tableData: [{
         date: '2016-05-02',
         name: '王小虎',
         address: '上海市普陀区金沙江路 1518 弄'
       }, {
         date: '2016-05-04',
         name: '王小虎',
         address: '上海市普陀区金沙江路 1517 弄'
       }, {
         date: '2016-05-01',
         name: '王小虎',
         address: '上海市普陀区金沙江路 1519 弄'
       }, {
         date: '2016-05-03',
         name: '王小虎',
         address: '上海市普陀区金沙江路 1516 弄'
       }]*/
    }
  },
  methods: {
    formatter(row, column) {
      return row.address;
    },


    ...mapActions('good',['getTableActions',])


  }


}
</script>

<style scoped>

</style>